﻿using System;
using System.Collections.Generic;
using System.Text;

namespace csharpcore7_ch6
{
    class DateTimeOffsetZone
    {
        static void _Main()
        {
            DateTimeOffset local = DateTimeOffset.Now;
            DateTimeOffset utc = local.ToUniversalTime();

            Console.WriteLine(local.Offset);//08:00:00 (在北京时间)
            Console.WriteLine(utc.Offset);//00:00:00
            Console.WriteLine(local == utc);    //True
            //在比较中将Offset也考虑在内，可以使用 EqualExact方法
            Console.WriteLine(local.EqualsExact(utc));  //False
        }
    }
}
